1. /* siorem.cpp by K.Tsuru */
  2. // function ID = 406 BRADIX
  3. /********************
  4. SInteger class
  5. It returns a remainder m%n.
  6. [Notice]
  7. Using the relations
  8. m=n*q+r (q = m/n)
  9. r = m-n*q
  10. i.e.
  11. m%n = m - n*(m/n)
  12. can be evaluated.
  13. *********************/
  14. #ifndef SN_H
  15. #include "sn.h"
  16. #endif
  17. // cannot inline function
  18. SInteger operator%(const SInteger& m, const SInteger& n){
  19. Ldiv_t r; //The type of "r" is INTGER(DRADIX).
  20. IIDiv(m, n, r, 1); //The type of "r" becomes BIN_INT.
  21. return r.rem;
  22. }

siorem.cpp : last modifiled at 2016/04/26 14:49:53(533 bytes)
created at 2016/04/25 14:53:17
The creation time of this html file is 2017/10/25 11:09:45 (Wed Oct 25 11:09:45 2017).